package com.example.shixunandjavagotoyangchen.BoosYang.Day003.Day003_FX2;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.shixunandjavagotoyangchen.R;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * 作者:二徒
 * 时间：2021/11/4- 8:29
 * 功能实现：
 */
public class CommunityAdpter extends BaseQuickAdapter<CommunityBean.DataBean, BaseViewHolder> {

    public CommunityAdpter( @Nullable List<CommunityBean.DataBean> data) {
        super(R.layout.communitydapao, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, CommunityBean.DataBean dataBean) {
        Glide.with(getContext()).load(dataBean.getVideomainimg()).into((ImageView) baseViewHolder.getView(R.id.communityXML_img1));

        Glide.with(getContext()).load(dataBean.getHeadpath()).circleCrop().into((ImageView) baseViewHolder.getView(R.id.communityXML_img2));

        baseViewHolder.setText(R.id.communityXML_text1,dataBean.getCaption());
        baseViewHolder.setText(R.id.communityXML_text2,dataBean.getAuthname());

    }
}
